package Infinite::Sequence::Guard;
use base qw{Infinite::Sequence};

sub new {
    my( $class, $sequence ) = @_;
    my $this = bless { sequence => $sequence }, $class;
    $this 
}

sub increment {
    my( $this ) = @_;
    my $val = $this->{sequence}->increment;
    $this->guard( $val ) ? $val : die ref($this)
}

sub guard { 1 }

1
